

class Node(object):
    def __init__(self, type, lineno=0, children=None, **kwargs):
        self.children = children if children else []
        self.type = type
        self.lineno = lineno
        self.data = kwargs

    def show_subtree(self, level=0):
        print '%s%s \\ ' % ('\t'*level, self.type)
        print '%s%s  ' % ('\t'*level, self.data)
        map(lambda x: x.show_subtree(level+1), filter(None, self.children))

    def __repr__(self):
        return 'Node(type=%s,data=%s)' % (self.type, self.data)

